import request from '@/utils/request'

export function getCatalogues(query) {
  return request({
    url: '/knowledge/catalogue/getList',
    method: 'post',
    data: query
  })
}


export function getCatalogueUsableList(query) {
  if(query != undefined){
    query = JSON.parse(JSON.stringify(query))
  }
  return request({
    url: '/knowledge/catalogue/getUsableList',
    method: 'post',
    data: query
  })
}
export function getCatalogue(id) {
  return request({
    url: '/knowledge/catalogue/getDetail',
    method: 'post',
    data: id
  })
}
export function changeStatusByCatalogueID(id) {
  return request({
    url: '/knowledge/catalogue/change-status',
    method: 'post',
    data: id
  })
}

export function saveCatalogue(formdata) {
  return request({
    url: '/knowledge/catalogue/save',
    method: 'post',
    data: formdata
  })
}

export function deleteCatalogueByID(id) {
  return request({
    url: '/knowledge/catalogue/delete',
    method: 'post',
    data: id
  })
}
export function removeCatalogueByID(id) {
  return request({
    url: '/knowledge/catalogue/remove',
    method: 'post',
    data: id
  })
}

export function getCataloguesAvabile() {
  return request({
    url: '/knowledge/catalogue/getAvailable',
    method: 'post'
  })
}
export function importCatalogue(data){
  return request({
    url: '/knowledge/catalogue/import',
    method: 'post',
    data: data
  })
}
